/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    
package be.vdabantwerpen.gow.dao;
    
import be.vdabantwerpen.gow.entities.Post;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Tim.VandenLangenberg
 * @version 12/06/2013
 */
public class PostDAOTemp implements PostDAO {
    private final List<Post> posts = new ArrayList();
    
    {
        //TODO: Vul posts
    }
    
    @Override
    public void create(Post post){
        posts.add(post);
    }
    
    @Override
    public Post read(int postId){
        for(int i = 0; i < posts.size(); i++){
            Post post = posts.get(i);
            //TODO: Identify post
        }
        return null;
    }
    
    @Override
    public void update(Post post){
        int index = posts.indexOf(post);
        posts.remove(index);
        posts.add(index, post);
    }
    
    @Override
    public void delete(Post post){
        posts.remove(post);
    }
    
    @Override
    public List<Post> findAll(){
        return posts;
    }
    
}